package wangjg.security.resource.factory.db.dao;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import wangjg.security.resource.factory.db.entity.Role;

@Repository
public class RoleDAO extends BasicBizDAO<Role,Integer>{

	public List<Role> findAll() {
		Criteria crit = this.createCriteria();
		crit.setCacheable(true);
		return crit.list();
	}
	
	public List<Role> findAllAminRole() {
		Criteria crit = this.createCriteria();
	    crit.add(Restrictions.eq("type", 0));
		crit.setCacheable(true);
		return crit.list();
	}
}
